﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Site.Master" AutoEventWireup="true" CodeBehind="WFVisualizaFuncionario.aspx.cs" Inherits="s2b.ControleDesenvolvimentoProjetos.WFVisualizaFuncionario" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:SqlDataSource ID="DSFUNCIONARIO" runat="server" 
        ConnectionString="<%$ ConnectionStrings:CS_DB_Controle_Projeto %>" DeleteCommand="DELETE FROM FUNCIONARIO
WHERE ID_FUNC = @ID_FUNC" InsertCommand="INSERT INTO FUNCIONARIO
(NOME_FUNC, SOBRE_NOME, EMAIL_FUNC, CARGO)
VALUES
(@NOME_FUNC, @SOBRE_NOME, @EMAIL_FUNC, @CARGO)" 
        SelectCommand="SELECT * FROM FUNCIONARIO" UpdateCommand="UPDATE FUNCIONARIO SET
NOME_FUNC = @NOME_FUNC,
SOBRE_NOME  = @SOBRE_NOME,
EMAIL_FUNC = @EMAIL_FUNC,
CARGO = @CARGO

WHERE ID_FUNC = @ID_FUNC


">
        <DeleteParameters>
            <asp:Parameter Name="ID_FUNC" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="NOME_FUNC" />
            <asp:Parameter Name="SOBRE_NOME" />
            <asp:Parameter Name="EMAIL_FUNC" />
            <asp:Parameter Name="CARGO" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="NOME_FUNC" />
            <asp:Parameter Name="SOBRE_NOME" />
            <asp:Parameter Name="EMAIL_FUNC" />
            <asp:Parameter Name="CARGO" />
            <asp:Parameter Name="ID_FUNC" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <asp:GridView ID="gdvFuncionario" runat="server" AllowPaging="True"  Width="100%"
        AutoGenerateColumns="False" DataKeyNames="ID_FUNC" 
        DataSourceID="DSFUNCIONARIO" onrowcommand="gdvFuncionario_RowCommand" 
        BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" 
        CellPadding="3" ForeColor="Black" GridLines="Vertical">
        <AlternatingRowStyle BackColor="#CCCCCC" />
        <Columns>
            <asp:BoundField DataField="ID_FUNC" HeaderText="Id funcionário" Visible="False" 
                ReadOnly="True" SortExpression="ID_FUNC" />
            <asp:BoundField DataField="NOME_FUNC" HeaderText="Nome" 
                SortExpression="NOME_FUNC" />
            <asp:BoundField DataField="SOBRE_NOME" HeaderText="Sobre nome" 
                SortExpression="SOBRE_NOME" />
            <asp:BoundField DataField="EMAIL_FUNC" HeaderText="Email" 
                SortExpression="EMAIL_FUNC" />
            <asp:BoundField DataField="CARGO" HeaderText="Cargo" SortExpression="CARGO" />
            <asp:ButtonField ButtonType="Image" CommandName="Delete" ImageUrl="~/Util/Imagens/delete.png"
                Text="Remover"></asp:ButtonField>
                <asp:ButtonField ButtonType="Image" CommandName="Edit"  ImageUrl="~/Util/Imagens/edit.png"
                Text="Editar"></asp:ButtonField>
                 <asp:ButtonField ButtonType="Image" CommandName="View"  ImageUrl="~/Util/Imagens/view.png"
                Text="Visualizar"></asp:ButtonField>
        </Columns>
        <FooterStyle BackColor="#CCCCCC" />
        <HeaderStyle BackColor="#000040" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#999999" ForeColor="#000040" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#808080" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#383838" />
    </asp:GridView>
</asp:Content>
